package com.hengxinguotong.hxgtwygsp.ui.newView.ownerComplaintEvaluate;

import android.content.res.Resources;
import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.hengxinguotong.hxgtwygsp.R;
import com.hengxinguotong.hxgtwygsp.ui.base.BaseDialogActivity;
import com.hengxinguotong.hxgtwygsp.widget.RingView;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 业主投诉受理及评价信息
 * Created by CS-Yong
 * 2019/9/2  0:30
 */
public class OwnerComplainEvaluateActivity extends BaseDialogActivity {
    @BindView(R.id.tv_img_title)
    TextView mTvImgTitle;
    @BindView(R.id.member_close)
    ImageView mMemberClose;
    @BindView(R.id.ring_accept_view)
    RingView mRingAcceptView;
    @BindView(R.id.suggestion_accept_num)
    TextView mSuggestionAcceptNum;
    @BindView(R.id.suggestion_dealt)
    TextView mSuggestionDealt;
    @BindView(R.id.suggestion_dealing)
    TextView mSuggestionDealing;
    @BindView(R.id.suggestion_dealt_num)
    TextView mSuggestionDealtNum;
    @BindView(R.id.suggestion_dealing_num)
    TextView mSuggestionDealingNum;
    @BindView(R.id.suggestion_dealt_rate)
    TextView mSuggestionDealtRate;
    @BindView(R.id.suggestion_dealing_rate)
    TextView mSuggestionDealingRate;
    @BindView(R.id.suggestion_accept_container)
    GridLayout mSuggestionAcceptContainer;
    @BindView(R.id.ring_deal_view)
    RingView mRingDealView;
    @BindView(R.id.suggestion_satisfied)
    TextView mSuggestionSatisfied;
    @BindView(R.id.suggestion_satisfied_more)
    TextView mSuggestionSatisfiedMore;
    @BindView(R.id.suggestion_satisfied_normal)
    TextView mSuggestionSatisfiedNormal;
    @BindView(R.id.suggestion_dissatisfied)
    TextView mSuggestionDissatisfied;
    @BindView(R.id.suggestion_satisfied_num)
    TextView mSuggestionSatisfiedNum;
    @BindView(R.id.suggestion_more_num)
    TextView mSuggestionMoreNum;
    @BindView(R.id.suggestion_normal_num)
    TextView mSuggestionNormalNum;
    @BindView(R.id.suggestion_dissatisfied_num)
    TextView mSuggestionDissatisfiedNum;
    @BindView(R.id.suggestion_satisfied_rate)
    TextView mSuggestionSatisfiedRate;
    @BindView(R.id.suggestion_more_rate)
    TextView mSuggestionMoreRate;
    @BindView(R.id.suggestion_normal_rate)
    TextView mSuggestionNormalRate;
    @BindView(R.id.suggestion_dissatisfied_rate)
    TextView mSuggestionDissatisfiedRate;
    @BindView(R.id.suggestion_deal_container)
    GridLayout mSuggestionDealContainer;

    @Override
    public int getLayoutResId() {
        return R.layout.activity_owner_complain_evaluate;
    }

    @Override
    public void init() {
        mockView();
    }

    @OnClick(R.id.member_close)
    public void onViewClicked() {
        finish();
    }


    private void mockView() {
        mSuggestionAcceptNum.setText(String.format(getString(R.string.suggestion_accept_num),10));
        mSuggestionDealtNum.setText(String.format(getString(R.string.suggestion_num),10));
        mSuggestionDealingNum.setText(String.format(getString(R.string.suggestion_num),0));
        mSuggestionDealtRate.setText(String.format(getString(R.string.suggestion_rate),100));
        mSuggestionDealingRate.setText(String.format(getString(R.string.suggestion_rate),0));
        mSuggestionSatisfiedNum.setText(String.format(getString(R.string.suggestion_num),6));
        mSuggestionMoreNum.setText(String.format(getString(R.string.suggestion_num),1));
        mSuggestionNormalNum.setText(String.format(getString(R.string.suggestion_num),1));
        mSuggestionDissatisfiedNum.setText(String.format(getString(R.string.suggestion_num),2));
        mSuggestionSatisfiedRate.setText(String.format(getString(R.string.suggestion_rate),60));
        mSuggestionMoreRate.setText(String.format(getString(R.string.suggestion_rate),10));
        mSuggestionNormalRate.setText(String.format(getString(R.string.suggestion_rate),10));
        mSuggestionDissatisfiedRate.setText(String.format(getString(R.string.suggestion_rate),20));


        Resources resources = getResources();
        int[] acceptColors = {resources.getColor(R.color.cFE5660), resources.getColor(R.color.c7250FC)};
        int[] dealColors = {resources.getColor(R.color.cFE5660), resources.getColor(R.color.cD1B83B), resources.getColor(R.color.c019FFF), resources.getColor(R.color.c7250FC)};
        float[] acceptValues = {10, 0};
        float[] dealValues = {6, 1, 1, 2};
        mRingAcceptView.setColors(acceptColors);
        mRingAcceptView.setValues(acceptValues);
        mRingDealView.setColors(dealColors);
        mRingDealView.setValues(dealValues);
    }

}
